package com.songcha.library_business.bean.book

import android.os.Parcel
import android.os.Parcelable
import com.songcha.library_network.bean.BaseBean

/*"id":8,
"bookId":10090,
"bookName":"灵石奇缘记",
"author":"白鑫",
"description":"    一座三层八角的大山中隐藏着一座与世隔绝的梅林园子，这里便是二十年前退隐江湖被外界称为‘枪神’——张宇沉的隐居之地",
"words":498009,
"keywords":"",
"totalChapters":115,
"cover":"http://songshu-cd.oss-cn-chengdu.aliyuncs.com/cover/90/19d2c775aaf3f17e7201cea652e1f89a.jpeg?x-oss-process=image%2Fresize%2Cw_300%2Ch_400%2Cm_lfit&OSSAccessKeyId=LTAI4G4RckqDECra6xMxWvd2&Expires=1694499944&Signature=5%2BSpTZ0GxT4wYh11zSq2lgS6U2Y%3D",
"cid":1,
"channelId":1,
"isVip":1,
"updateTime":"1970-01-19 22:00",
"status":2,
"rate":"普通"*/

data class BookDetailNetBean(val data:DataBean):BaseBean() {
    data class DataBean(val id:Int,val bookId:Int,val bookName:String,val author:String,val description:String,val words:Int,
                                 val totalChapters:Int,val cover:String,val cid:Int,val channelId:Int,val isVip:Int,val updateTime:String,
                                 val status:Int,val rate:String,val averageRating:Float):Parcelable{
        constructor(parcel: Parcel) : this(
            parcel.readInt(),
            parcel.readInt(),
            parcel.readString()?:"",
            parcel.readString()?:"",
            parcel.readString()?:"",
            parcel.readInt(),
            parcel.readInt(),
            parcel.readString()?:"",
            parcel.readInt(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readString()?:"",
            parcel.readInt(),
            parcel.readString()?:"",
            parcel.readFloat()
        ) {
        }

        override fun writeToParcel(parcel: Parcel, flags: Int) {
            parcel.writeInt(id)
            parcel.writeInt(bookId)
            parcel.writeString(bookName)
            parcel.writeString(author)
            parcel.writeString(description)
            parcel.writeInt(words)
            parcel.writeInt(totalChapters)
            parcel.writeString(cover)
            parcel.writeInt(cid)
            parcel.writeInt(channelId)
            parcel.writeInt(isVip)
            parcel.writeString(updateTime)
            parcel.writeInt(status)
            parcel.writeString(rate)
            parcel.writeFloat(averageRating)
        }

        override fun describeContents(): Int {
            return 0
        }

        companion object CREATOR : Parcelable.Creator<DataBean> {
            override fun createFromParcel(parcel: Parcel): DataBean {
                return DataBean(parcel)
            }

            override fun newArray(size: Int): Array<DataBean?> {
                return arrayOfNulls(size)
            }
        }

    }
}